<template>
  <div v-loading="showLoading" class="app-containers">
    <div class="form-card">
      <el-card>
        <div class="file-box" v-if="flagDisplay">
          <div class="file-box-title">客户征信文件</div>
          <div class="file-box-content">
            <div class="file-left">
              <div class="file-image">
                <img src="@/assets/images/file.jpg" alt="" />
              </div>
              <div class="file-msg">
                <div style="padding-top: 12px;">征信报告.pdf</div>
              </div>
            </div>
            <div class="file-right">
              <div class="doloadFile" @click="downLoadFile()">下载PDF文件</div>
            </div>
          </div>
        </div>
        <!-- <div slot="header" style="text-align: center">
          <div style="margin-right: 20px;font-weight: bold">征信录入</div>
        </div> -->
        <div v-if="flagCtr" style="margin: 10px 0">基本报告信息</div>
        <el-table v-if="flagCtr" size="mini" :data="basicReporter" border>
          <el-table-column align="center" label="姓名">
            <template slot-scope="scope">
              <span>{{ scope.row.name || "-" }}</span>
            </template>
          </el-table-column>
          <el-table-column align="center" label="证件号码">
            <template slot-scope="scope">
              <span>{{ scope.row.idCard || "-" }}</span>
            </template>
          </el-table-column>
          <el-table-column align="center" label="查询机构">
            <template slot-scope="scope">
              <span>{{ scope.row.queryAgency || "-" }}</span>
            </template>
          </el-table-column>
          <el-table-column align="center" label="查询原因">
            <template slot-scope="scope">
              <span>{{ scope.row.queryReason || "-" }}</span>
            </template>
          </el-table-column>
          <el-table-column align="center" label="查询时间">
            <template slot-scope="scope">
              <span>{{ scope.row.reportTime || "-" }}</span>
            </template>
          </el-table-column>
        </el-table>
        <div v-if="flagCtr" style="margin: 10px 0">信贷交易信息提示</div>
        <el-table v-if="flagCtr" size="mini" :data="creditTradingList" border>
          <el-table-column align="center" label="账户类型" prop="accountType">
            <template slot-scope="scope">
              {{ scope.row.accountType == "loan" ? "贷款" : "信用卡" }}
            </template>
          </el-table-column>
          <el-table-column align="center" prop="businessType" label="业务类型">
          </el-table-column>
          <el-table-column label="账户数" align="center">
            <template slot-scope="scope">
              <span>{{ scope.row.accountCount || "-" }}</span>
            </template>
          </el-table-column>
          <el-table-column label="首笔业务发放月份" align="center">
            <template slot-scope="scope">
              {{ scope.row.firstMonth || "-" }}
            </template>
          </el-table-column>
        </el-table>
        <div v-if="flagCtr" style="margin: 10px 0">信贷交易违约信息概要</div>
        <div v-if="flagCtr" class="table-top-title">
          <span>逾期（透支）信息汇总</span>
        </div>
        <el-table v-if="flagCtr" size="mini" :data="creditOverdueList" border>
          <el-table-column prop="accountType" align="center" label="账户类型">
          </el-table-column>
          <el-table-column align="center" label="账户数">
            <template slot-scope="scope">
              <span>{{ scope.row.accountCount || "-" }}</span>
            </template>
          </el-table-column>
          <el-table-column align="center" label="月份数">
            <template slot-scope="scope">
              <span>{{ scope.row.overMonth || "-" }}</span>
            </template>
          </el-table-column>
          <el-table-column align="center" label="单月最高逾期/透支总额">
            <template slot-scope="scope">
              <span>{{ scope.row.overAmount || "-" }}</span>
            </template>
          </el-table-column>
          <el-table-column align="center" label="最长逾期/透支月数">
            <template slot-scope="scope">
              <span>{{ scope.row.overMonthCount || "-" }}</span>
            </template>
          </el-table-column>
        </el-table>

        <div v-if="flagCtr" style="margin: 10px 0">
          信贷交易授信及负债信息概要（未结清/未销户）
        </div>

        <div
          v-if="flagCtr"
          style="margin-top: 30px"
          v-for="(item, index) in creditDebtLoopList"
          :key="index + 'a'"
        >
          <div class="table-top-title">
            <span>{{ item.title }}</span>
          </div>
          <el-table size="mini" :data="[item]" border>
            <el-table-column align="center" label="管理机构数">
              <template slot-scope="scope">
                <span>{{ scope.row.agencyCount || "-" }}</span>
              </template>
            </el-table-column>
            <el-table-column align="center" label="账户数">
              <template slot-scope="scope">
                <span>{{ scope.row.accountCount || "-" }}</span>
              </template>
            </el-table-column>
            <el-table-column align="center" label="授信总额">
              <template slot-scope="scope">
                <span>{{ scope.row.creditAmount || "-" }}</span>
              </template>
            </el-table-column>
            <el-table-column align="center" label="余额">
              <template slot-scope="scope">
                <span>{{ scope.row.balance || "-" }}</span>
              </template>
            </el-table-column>
            <el-table-column align="center" label="最近6个月平均应还款">
              <template slot-scope="scope">
                <span>{{ scope.row.avgAmount6 || "-" }}</span>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <div
          v-if="flagCtr"
          style="margin-top: 30px"
          v-for="(item, index) in creditDebtLoanList"
          :key="index + 'b'"
        >
          <div class="table-top-title">
            <span>{{ item.title }}</span>
          </div>

          <el-table size="mini" :data="[item]" border>
            <el-table-column align="center" label="发卡机构数">
              <template slot-scope="scope">
                <span>{{ scope.row.hairClipCount || "-" }}</span>
              </template>
            </el-table-column>
            <el-table-column align="center" label="账户数">
              <template slot-scope="scope">
                <span>{{ scope.row.accountCount || "-" }}</span>
              </template>
            </el-table-column>
            <el-table-column align="center" label="授信总额">
              <template slot-scope="scope">
                <span>{{ scope.row.creditAmount || "-" }}</span>
              </template>
            </el-table-column>
            <el-table-column align="center" label="单家机构最高授信额">
              <template slot-scope="scope">
                <span>{{ scope.row.maxAmount || "-" }}</span>
              </template>
            </el-table-column>
            <el-table-column align="center" label="单家机构最低授信额">
              <template slot-scope="scope">
                <span>{{ scope.row.minAmount || "-" }}</span>
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              :label="
                item.titleType == 'creditAccount' ? '已用额度' : '透支额度'
              "
            >
              <template slot-scope="scope">
                <span>{{ scope.row.usedAmount || "-" }}</span>
              </template>
            </el-table-column>
            <el-table-column label="最近6个月平均应还款" align="center">
              <template slot-scope="scope">
                <span>{{ scope.row.avgAmount6 || "-" }}</span>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <div v-if="flagCtr" style="margin-top: 20px" class="table-top-title">
          相关还款责任信息汇总
        </div>
        <div
          v-if="flagCtr"
          style=" width: 100%; display: flex; flex-wrap: wrap"
        >
          <div
            style="width: 50%; margin-bottom: 20px"
            v-for="(item, index) in creditDebtDutyList"
            :key="index + 'c'"
          >
            <div>
              <div class="table-top-title">
                <span>{{
                  `${
                    item.dutyType == "guarantee"
                      ? "担保责任"
                      : "其它相关还款责任"
                  }` +
                    "-" +
                    `${item.type == "company" ? "为企业" : "为个人"}`
                }}</span>
              </div>

              <div>
                <el-table size="mini" :data="[item]" border>
                  <el-table-column align="center" label="账户数">
                    <template slot-scope="scope">
                      <span>{{ scope.row.accountCount || "-" }}</span>
                    </template>
                  </el-table-column>
                  <el-table-column
                    align="center"
                    :label="
                      `${
                        item.dutyType == 'guarantee'
                          ? '担保责任金额'
                          : '其它还款责任金额'
                      }`
                    "
                  >
                    <template slot-scope="scope">
                      <div>{{ scope.row.dutyAmount || "-" }}</div>
                    </template>
                  </el-table-column>
                  <el-table-column align="center" label="余额">
                    <template slot-scope="scope">
                      <span>{{ scope.row.balance || "-" }}</span>
                    </template>
                  </el-table-column>
                </el-table>
              </div>
            </div>
          </div>
        </div>
        <div v-if="flagCtr" style="margin: 10px 0">查询记录概要</div>
        <div v-if="flagCtr" style="width: 100%; display: flex">
          <div style="width: 20%">
            <div class="table-top-title">
              <span>最近1个月内的查询机构数</span>
            </div>
            <el-table size="mini" :data="oneMonthdictNum" border>
              <el-table-column align="center" label="贷款审批">
                <template slot-scope="scope">
                  <span>{{ scope.row.loanApprovalDept || "-" }}</span>
                </template>
              </el-table-column>
              <el-table-column align="center" label="信用卡审批">
                <template slot-scope="scope">
                  <span>{{ scope.row.cardApprovalDept || "-" }}</span>
                </template>
              </el-table-column>
            </el-table>
          </div>
          <div style="width: 40%">
            <div class="table-top-title">
              <span>最近1个月内的查询次数</span>
            </div>
            <el-table size="mini" :data="oneMonthsearchNum" border>
              <el-table-column align="center" label="贷款审批">
                <template slot-scope="scope">
                  <span>{{ scope.row.loanApprovalNum || "-" }}</span>
                </template>
              </el-table-column>
              <el-table-column align="center" label="信用卡审批">
                <template slot-scope="scope">
                  <span>{{ scope.row.cardApprovalNum || "-" }}</span>
                </template>
              </el-table-column>
              <el-table-column label="本人查询" align="center">
                <template slot-scope="scope">
                  <span>{{ scope.row.ownQueryNum || "-" }}</span>
                </template>
              </el-table-column>
            </el-table>
          </div>
          <div style="width: 40%">
            <div class="table-top-title">
              <span>最近2年内的查询机构数</span>
            </div>
            <el-table size="mini" :data="twoYearSearchNum" border>
              <el-table-column align="center" label="贷后管理">
                <template slot-scope="scope">
                  <span>{{ scope.row.loanManage || "-" }}</span>
                </template>
              </el-table-column>
              <el-table-column align="center" label="担保资格审查">
                <template slot-scope="scope">
                  <span>{{ scope.row.guaranteeQualification || "-" }}</span>
                </template>
              </el-table-column>
              <el-table-column label="特约商户实名审查" align="center">
                <template slot-scope="scope">
                  <span>{{ scope.row.merchantApproval || "-" }}</span>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </div>
        <div v-if="flagCtr" style="margin: 10px 0">查询次数</div>
        <div v-if="flagCtr" style="width: 100%; display: flex">
          <el-table size="mini" :data="creditQueryCounts" border>
            <el-table-column label="查询身份" align="center">
              <template slot-scope="scope">
                {{ scope.row.standType == 1 ? "机构查询" : "本人查询" }}
              </template>
            </el-table-column>
            <el-table-column label="1个月查询次数" align="center">
              <template slot-scope="scope">
                <span>{{ scope.row.monthQueryCount1 || "-" }}次</span>
              </template>
            </el-table-column>
            <el-table-column label="2个月查询次数" align="center">
              <template slot-scope="scope">
                <span>{{ scope.row.monthQueryCount2 || "-" }}次</span>
              </template>
            </el-table-column>
            <el-table-column label="3个月查询次数" align="center">
              <template slot-scope="scope">
                <span>{{ scope.row.monthQueryCount3 || "-" }}次</span>
              </template>
            </el-table-column>
            <el-table-column label="6个月查询次数" align="center">
              <template slot-scope="scope">
                <span>{{ scope.row.monthQueryCount6 || "-" }}次</span>
              </template>
            </el-table-column>
            <el-table-column label="12个月查询次数" align="center">
              <template slot-scope="scope">
                <div>{{ scope.row.monthQueryCount12 || "-" }}次</div>
              </template>
            </el-table-column>
            <el-table-column label="24个月查询次数" align="center">
              <template slot-scope="scope">
                <span>{{ scope.row.monthQueryCount24 || "-" }}次</span>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <!-- </el-card> -->
        <!-- <el-card class="suffi" style="margin-top: 20px; padding-right: 160px"> -->
        <div v-if="flagCtr" style="margin: 10px 0">个人逾期情况</div>
        <el-table v-if="flagCtr" :data="creditPersonOverdues" border>
          <el-table-column label="逾期时间" align="center">
            <template slot-scope="scope">
              <span v-if="scope.row.lastType == 1">近3个月</span>
              <span v-if="scope.row.lastType == 2">近6个月</span>
              <span v-if="scope.row.lastType == 3">近1年</span>
              <span v-if="scope.row.lastType == 4">近2年</span
              ><span v-if="scope.row.lastType == 5">近3年</span>
              <span v-if="scope.row.lastType == 6">近5年</span>
              <span v-if="scope.row.lastType == 7">累计</span>
            </template>
          </el-table-column>
          <el-table-column label="还款状态“1”" align="center">
            <template slot-scope="scope">
              <span>{{ scope.row.statusCount1 || "-" }}次</span>
            </template>
          </el-table-column>
          <el-table-column label="还款状态“2”" align="center">
            <template slot-scope="scope">
              <span>{{ scope.row.statusCount2 || "-" }}次</span>
            </template>
          </el-table-column>
          <el-table-column label="还款状态“3”" align="center">
            <template slot-scope="scope">
              <span>{{ scope.row.statusCount3 || "-" }}次</span>
            </template>
          </el-table-column>
          <el-table-column label="还款状态“4”" align="center">
            <template slot-scope="scope">
              <span>{{ scope.row.statusCount4 || "-" }}次</span>
            </template>
          </el-table-column>
          <el-table-column label="还款状态“5”" align="center">
            <template slot-scope="scope">
              <span>{{ scope.row.statusCount5 || "-" }}次</span>
            </template>
          </el-table-column>
          <el-table-column label="还款状态“6”" align="center">
            <template slot-scope="scope">
              <span>{{ scope.row.statusCount6 || "-" }}次</span>
            </template>
          </el-table-column>
          <el-table-column label="还款状态“7”" align="center">
            <template slot-scope="scope">
              <span>{{ scope.row.statusCount7 || "-" }}次</span>
            </template>
          </el-table-column>
        </el-table>
        <div v-if="flagCtr">
          征信信息
        </div>
        <div v-if="flagCtr" class="message-box">
          <el-form
            :model="form"
            size="small"
            label-width="150px"
            style="margin-top: 20px"
            ref="formRef"
          >
            <el-row>
              <el-col :span="12">
                <div
                  style="width: 656px;height: 56px;padding-top:14px;background: #F5F5F5;"
                >
                  <el-form-item label="个人负债：">
                    <span style="color: #000"
                      >{{ form.personDebt || "-" }}元</span
                    >
                  </el-form-item>
                </div>
              </el-col>
              <el-col :span="12">
                <div
                  style="width: 656px;height: 56px;padding-top:14px;background: #F5F5F5;"
                >
                  <el-form-item label="网贷笔数：">
                    <div>{{ form.network || "-" }}笔</div>
                  </el-form-item>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <div style="width: 656px;height: 56px;padding-top:14px;">
                  <el-form-item label="个人逾期金额：">
                    <span>{{ form.personOverDebt || "-" }}</span>
                    <span style="color: #000">元</span>
                  </el-form-item>
                </div>
              </el-col>
              <el-col :span="12">
                <div style="width: 656px;height: 56px;padding-top:14px;">
                  <el-form-item label="有无连三累六：">
                    <span>{{ form.threeSixStatus || "-" }}</span>
                  </el-form-item>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <div
                  style="width: 656px;height: 56px;padding-top:14px;background: #F5F5F5;"
                >
                  <el-form-item label="账户状态：">
                    <span>{{ form.accountStatus || "-" }}</span>
                  </el-form-item>
                </div>
              </el-col>
              <el-col :span="12">
                <div
                  style="width: 656px;height: 56px;padding-top:14px;background: #F5F5F5;"
                >
                  <el-form-item label="五级分类：">
                    <span>{{ form.fiveTypeStatus || "-" }}</span>
                  </el-form-item>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <div style="width: 656px;height: 56px;padding-top:14px;">
                  <el-form-item label="是否为白户：">
                    <!-- <el-radio-group v-model="form.whiteStatus">
                  <el-radio
                    v-for="(item, index) in system_yes_noList"
                    :key="index"
                    :label="item.value"
                    >{{ item.label }}</el-radio
                  >
                </el-radio-group> -->
                    <span>{{ form.whiteStatus || "-" }}</span>
                  </el-form-item>
                </div>
              </el-col>
              <el-col :span="12">
                <div style="width: 656px;height: 56px;padding-top:14px;">
                  <el-form-item label="婚姻状况：">
                    <span>{{ form.maritalStatus || "-" }}</span>
                  </el-form-item>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <div
                  style="width: 656px;height: 56px;padding-top:14px;background: #F5F5F5;"
                >
                  <el-form-item label="授信机构数：">
                    <span>{{ form.creditCount || "-" }}</span>
                  </el-form-item>
                </div>
              </el-col>
              <el-col :span="12">
                <div
                  style="width: 656px;height: 56px;padding-top:14px;background: #F5F5F5;"
                >
                  <el-form-item label="授信总金额：">
                    <span>{{ form.creditAmount || "-" }}</span
                    ><span style="color: #000">元</span>
                  </el-form-item>
                </div>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="12">
                <div style="width: 656px;height: 56px;padding-top:14px;">
                  <el-form-item label="个人逾期情况：">
                    <span>{{ form.personOverStatus == 0 ? "无" : "有" }}</span>
                  </el-form-item>
                </div>
              </el-col>
            </el-row>
          </el-form>
        </div>
      </el-card>
    </div>
  </div>
</template>

<script>
const form = {
  personDebt: null,
  network: null,
  personOverDebt: null, //个人逾期金额
  threeSixStatus: null,
  accountStatus: null,
  fiveTypeStatus: null,
  whiteStatus: null,
  creditCount: null,
  creditAmount: null,
  maritalStatus: null,
  showLoading: false
};
// import download from "../../../../utils/downloadFile";
import {
  addCreditInfo,
  getCreditInfo,
  getCreditInfoTask
} from "@/api/customer";
import { checkFile } from "@/api/system";
import {
  basicReporter,
  creditTradingList,
  creditOverdueList,
  creditDebtLoopList,
  creditDebtLoanList,
  creditDebtDutyList,
  oneMonthdictNum,
  oneMonthsearchNum,
  twoYearSearchNum,
  creditQueryCounts,
  creditPersonOverdues
} from "../../options";
import basicInfo from "./../components/basicInfo.vue";
import * as download from "@/utils/downloadFile";
export default {
  computed: {
    basicInfo() {
      return basicInfo;
    }
  },
  props: {
    detailInfo: {
      type: Object,
      default: () => {
        return {};
      }
    }
  },
  data() {
    return {
      form: Object.assign({}, form),
      showLoading: false,
      creditUrlName: "",
      creditUrlNamePage: "",
      creditUrl: "",
      flagCtr: true,
      noHaveList: [],
      system_n_aList: [],
      system_yes_noList: [],
      custom_cate_type: [],
      imgList: [],
      basicReporter,
      creditTradingList,
      creditOverdueList,
      creditDebtLoopList, //信贷交易授信及负债信息概要（未结清/未销户）
      creditDebtLoanList,
      creditDebtDutyList,
      oneMonthdictNum,
      oneMonthsearchNum,
      twoYearSearchNum,
      creditQueryCounts,
      creditPersonOverdues,
      flagDisplay: true
    };
  },
  async mounted() {},
  async created() {
    // this.getInfo();
    this.flagCtr = this.$route.query.data ? false : true;
    const p1 = this.$getDictData("system_n_a");
    const p2 = this.$getDictData("system_yes_no");
    const p3 = this.$getDictData("custom_cate_type");
    Promise.all([p1, p2, p3]).then(res => {
      this.system_n_aList = res[0];
      this.system_yes_noList = res[1];
      this.custom_cate_type = res[2];
      this.getInfo();
    });
  },
  methods: {
    downLoadFile() {
      const path = require("path");
      checkFile({
        filePath: this.creditUrl
      }).then(res => {
        if (res.data) {
          download.downloadFile(`${path.basename(this.creditUrl)}`, {
            filePath: this.creditUrl
          });
        } else {
          this.$message({
            message: "暂无文件",
            type: "warning"
          });
        }
      });
    },
    creditTask() {
      let params = {
        creditId: "1",
        file:
          "https://julimeng-dev.oss-cn-hangzhou.aliyuncs.com/managehub/credit/20240603/CI_8OVlglqCxSCwGyFLCN.pdf"
      };
      getCreditInfoTask(params).then(res => {
        console.log(res);
      });
    },
    // downLoadFile() {
    // let name =
    //   "https://julimeng-dev.oss-cn-hangzhou.aliyuncs.com/managehub/credit/20240603/CI_8OVlglqCxSCwGyFLCN.pdf";
    // download.downloadFile(name, { fileName: name });
    // },

    getInfo() {
      this.showLoading = true;
      // if (this.$route.query.machType && this.$route.query.id) {
      if (true) {
        let params = {
          matchId: this.detailInfo.id,
          matchType: this.detailInfo.matchType
        };
        getCreditInfo(params)
          .then(res => {
            if (res.data.creditBaseInfo === null) {
              this.flagDisplay = false;
            }
            try {
              this.basicReporter = [
                {
                  name: res.data.creditBaseInfo.name,
                  idCard: res.data.creditBaseInfo.idCard,
                  queryAgency: res.data.creditBaseInfo.queryAgency,
                  queryReason: res.data.creditBaseInfo.queryReason,
                  reportTime: res.data.creditBaseInfo.reportTime
                }
              ];
              if (res.data.creditTradingList.length > 0) {
                this.creditTradingList = res.data.creditTradingList;
              }

              if (res.data.creditOverdueList.length > 0) {
                this.creditOverdueList = res.data.creditOverdueList;
              }
              if (res.data.creditDebtInfo.creditDebtLoopList.length > 0) {
                this.creditDebtLoopList =
                  res.data.creditDebtInfo.creditDebtLoopList;
              }
              if (res.data.creditDebtInfo.creditDebtLoanList.length > 0) {
                this.creditDebtLoanList =
                  res.data.creditDebtInfo.creditDebtLoanList;
              }
              if (res.data.creditDebtInfo.creditDebtDutyList.length > 0) {
                this.creditDebtDutyList =
                  res.data.creditDebtInfo.creditDebtDutyList;
              }
              if (res.data.creditPersonOverdues.length > 0) {
                this.creditPersonOverdues = res.data.creditPersonOverdues;
              }
              if (res.data.creditQueryCounts.length > 0) {
                this.creditQueryCounts = res.data.creditQueryCounts;
              }
              this.oneMonthdictNum = [
                {
                  loanApprovalDept:
                    res.data.creditSummaryRecordDto.loanApprovalDept,
                  cardApprovalDept:
                    res.data.creditSummaryRecordDto.cardApprovalDept
                }
              ];
              this.oneMonthsearchNum = [
                {
                  loanApprovalNum:
                    res.data.creditSummaryRecordDto.loanApprovalNum,
                  cardApprovalNum:
                    res.data.creditSummaryRecordDto.cardApprovalNum,
                  ownQueryNum: res.data.creditSummaryRecordDto.ownQueryNum
                }
              ];
              this.twoYearSearchNum = [
                {
                  loanManage: res.data.creditSummaryRecordDto.loanManage,
                  guaranteeQualification:
                    res.data.creditSummaryRecordDto.guaranteeQualification,
                  merchantApproval:
                    res.data.creditSummaryRecordDto.merchantApproval
                }
              ];
              this.$dictTypeFun(
                res.data.creditBaseInfo.fiveTypeStatus,
                "custom_cate_type"
              ).then(res => {
                this.form.fiveTypeStatus = res.toString();
              });
              this.$dictTypeFun(
                res.data.creditBaseInfo.threeSixStatus,
                "person_over_status"
              ).then(res => {
                this.form.threeSixStatus = res.toString();
              });
              this.$dictTypeFun(
                res.data.creditBaseInfo.accountStatus,
                "account"
              ).then(res => {
                this.form.accountStatus = res.toString();
              });
              this.$dictTypeFun(
                res.data.creditBaseInfo.whiteStatus,
                "system_yes_no"
              ).then(res => {
                this.form.whiteStatus = res.toString();
              });
              this.$dictTypeFun(
                res.data.creditBaseInfo.maritalStatus,
                "marriage_status"
              ).then(res => {
                console.log("maritalStatus", this.form.maritalStatus);
                this.form.maritalStatus = res.toString();
              });
            } catch (error) {}
            this.creditUrlName = res.data.creditBaseInfo.creditUrl
              .split("/")
              .slice(3)
              .join("/");
            let newArr = res.data.creditBaseInfo.creditUrl.split("/");
            this.creditUrlNamePage = newArr[newArr.length - 1];
            this.creditUrl = res.data.creditBaseInfo.creditUrl;
            this.form = Object.assign({}, res.data.creditBaseInfo);
            this.showLoading = false;
          })
          .finally(() => {
            this.showLoading = false;
          });
      }
    },
    submitForm(formName) {
      this.$refs[formName].validate(valid => {
        // console.log(this.form);
        if (valid) {
          let creditBaseInfo = Object.assign(
            {},
            this.form,
            this.basicReporter[0]
          );

          console.log(creditBaseInfo);
          // return
          const params = {
            matchId: 1,
            matchType: 1,
            // id: this.$route.query.id,
            // machType: this.$route.query.machType,
            creditBaseInfo,
            creditQueryCounts: this.creditQueryCounts,
            creditPersonOverdues: this.creditPersonOverdues,
            creditTradingList: this.creditTradingList,
            creditOverdueList: this.creditOverdueList,
            creditDebtInfo: {
              creditDebtLoopList: this.creditDebtLoopList,
              creditDebtLoanList: this.creditDebtLoanList,
              creditDebtDutyList: this.creditDebtDutyList
            },
            creditSummaryRecordDto: {
              ...this.oneMonthdictNum[0],
              ...this.oneMonthsearchNum[0],
              ...this.twoYearSearchNum[0]
            }
          };
          addCreditInfo(params).then(res => {
            console.log(res);
            this.$message({
              message: "保存成功",
              type: "success"
            });
          });
        }
      });
    }
  }
};
</script>

<style lang="scss" scoped>
/deep/.el-table th.el-table__cell > .cell {
  white-space: nowrap;
}
/deep/.el-table--scrollable-x .el-table__body-wrapper {
  overflow: hidden;
}
.app-containers {
  background-color: #f5f5f5;
  position: relative;
}
.form-card {
  // height: calc(100% - 60px);
  // overflow-y: scroll;
  .campany-title {
    display: flex;
    align-items: center;
  }
}

.form-main {
  height: calc(
    100% - 80px
  ); /* 将高度设置为父级容器高度减去上方固定元素的高度 */
  overflow-y: auto;
}
.file-box {
  .file-box-title {
    font-weight: bold;
    font-size: 16px;
  }
  .file-box-content {
    margin-top: 10px;
    display: flex;
    .file-left {
      width: 300px;
      height: 100px;
      //line-height: 100px;
      background-color: #fff1f1;
      border-radius: 8px;
      margin-right: 30px;
      display: flex;

      .file-image {
        margin-top: 25px;
        width: 50px;
        height: 50px;
        //background-color: deeppink;
        margin-left: 30px;
        margin-right: 10px;
        img {
          width: 100%;
          height: 100%;
        }
      }
      .file-msg {
        margin-top: 30px;
        height: 50px;
        > div {
          color: #000;
          &:nth-child(1) {
            font-size: 14px;
          }
          &:nth-child(2) {
            margin-top: 10px;
            font-size: 12px;
          }
        }
      }
    }
    .file-right {
      padding: 33px 0;
      .doloadFile {
        width: 108px;
        height: 32px;
        border-radius: 4px;
        background: #d1e8ff;
        color: #409eff;
        line-height: 32px;
        font-size: 14px;
        text-align: center;
        cursor: pointer;
      }
    }
  }
}

/deep/.suffi .el-input__suffix-inner {
  > span {
    display: inline-block;
    margin-top: 5px !important;
  }
}
.table-top-title {
  text-align: center;
  border: 1px solid #eee;
  border-bottom: none;
  height: 44px;

  line-height: 44px;
  color: #222;
  > span {
    font-size: 16px;
    font-weight: 500;
  }
}
</style>
